<!DOCTYPE html>
<html>
  <head>
    <title><%= content_for(:title) || t('common.jinyugoods') %></title>
    <meta name="viewport" content="width=device-width,initial-scale=1">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="mobile-web-app-capable" content="yes">
    <%= csrf_meta_tags %>
    <%= csp_meta_tag %>

    <%= yield :head %>
    <%= yield :styles %>

    <%# Enable PWA manifest for installable apps (make sure to enable in config/routes.rb too!) %>
    <%#= tag.link rel: "manifest", href: pwa_manifest_path(format: :json) %>

    <link rel="icon" href="/icon.png" type="image/png">
    
    <link rel="apple-touch-icon" href="/icon.png">

    <%# Includes all stylesheet files in app/assets/stylesheets %>
    <%= stylesheet_link_tag :app, "data-turbo-track": "reload" %>
    <%= javascript_importmap_tags %>
  </head>

  <body>
    <nav class="sticky top-0 left-0 right-0 bg-white shadow-md z-50">
      <div class="container mx-auto px-5">
        <div class="flex justify-between items-center h-16">
          <div class="flex items-center space-x-8">
            <%= link_to root_path, class: "flex items-center" do %>
              <img src="https://cms.s3.cn-northwest-1.amazonaws.com.cn/a36b86f7-b57c-459a-a62c-47e21cadf9f4-2025-05-15+09%3A20%3A00+%2B0800-jinyulogo.png" alt="Jinyugoods Logo" class="h-8 w-8 mr-2">
              <span class="text-xl font-semibold text-gray-800 hidden md:block"><%= t('common.jinyugoods').upcase %></span>
            <% end %>
           
          </div>
          <div class="relative hidden">
            <select id="language-switcher" class="appearance-none bg-white border border-gray-300 rounded-md px-3 py-2 text-gray-700 focus:outline-none focus:ring-2 focus:ring-blue-500" onchange="window.location.href=this.value">
              <option value="<%= url_for(locale: :en) %>" <%= 'selected' if I18n.locale == :en %>>English</option>
              <option value="<%= url_for(locale: :uk) %>" <%= 'selected' if I18n.locale == :uk %>>Українська</option>
              <option value="<%= url_for(locale: :ru) %>" <%= 'selected' if I18n.locale == :ru %>>Русский</option>
              <option value="<%= url_for(locale: :zh) %>" <%= 'selected' if I18n.locale == :zh %>>中文</option>
            </select>
          </div>
        </div>
      </div>
    </nav>
    <%= yield :banner %>
    <main class="container mx-auto mt-28 px-5 flex flex-col">
      <%= yield %>
    </main>
    <%= render "layouts/footer" %>
    
    <%= yield :scripts %>
  </body>
</html>
